<input type="hidden" name="pcancel" id="pcancel" value="0" />
{if isset($type)}
    <div class="secSearch">
    	<table cellpadding="0" cellspacing="0" border="0" width="100%">
       		<tbody>
    			{if $type == 1}            
                    <tr>
                        <td class="firstChild" width="20%">
                            <label for="poption">Tìm theo:</label>
                            <select name="poption" id="poption">
                                <option value="">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrOption selected=$smarty.session.post.poption}
                                {else}
                                	{html_options options=$arrOption}
                                {/if}
                            </select>
                        </td>
                        <td width="20%" class="text">
                            <label for="pkey">Từ khóa:</label>
                            <input type="text" name="pkey" id="pkey" value="{if isset($smarty.session.post)}{$smarty.session.post.pkey|escape}{/if}"/>
                        </td>
                        <td width="20%">
                            <label for="pgender">Giới tính:</label>
                            <select name="pgender" id="pgender">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrGender selected=$smarty.session.post.pgender}
                                {else}
                                	{html_options options=$arrGender}
                                {/if}
                            </select>
                        </td>
                        <td width="20%">
                            <label for="pcountry">Quốc gia:</label>
                            <select name="pcountry" id="pcountry">
                            	{if isset($smarty.session.post)}
                                	{html_options options=$arrCountry selected=$smarty.session.post.pcountry}
                                {else}
                                	{html_options options=$arrCountry selected=$smarty.const.COUNTRY_DEFAULT}
                                {/if}
                            </select>
                        </td>
                        <td width="20%" class="lastChild">
                            <label for="pprovince">Tỉnh/thành:</label>
                            <select name="pprovince" id="pprovince">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrProvince selected=$smarty.session.post.pprovince}
                                {else}
                                	{html_options options=$arrProvince}
                                {/if}
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="firstChild">
                            <label for="pafrom">Độ tuổi:</label>
                            <select name="pafrom" id="pafrom" class="half firstItem">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrAge selected=$smarty.session.post.pafrom}
                                {else}
                                	{html_options options=$arrAge}
                                {/if}
                            </select>
                            <select name="pato" id="pato" class="half">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrAge selected=$smarty.session.post.pato}
                                {else}
                                	{html_options options=$arrAge}
                                {/if}
                            </select>
                        </td>
                        <td width="20%">
                            <label for="preligion">Tôn giáo:</label>
                            <select name="preligion" id="preligion">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrReligion selected=$smarty.session.post.preligion}
                                {else}
                                	{html_options options=$arrReligion}
                                {/if}
                            </select>
                        </td>
                        <td width="20%">
                            <label for="peducation">Trình độ học vấn:</label>
                            <select name="peducation" id="peducation">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrEducation selected=$smarty.session.post.peducation}
                                {else}
                                	{html_options options=$arrEducation}
                                {/if}
                            </select>
                        </td>
                        <td width="20%">
                            <label for="poccupation">Nghề nghiệp:</label>
                            <select name="poccupation" id="poccupation">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrOccupation selected=$smarty.session.post.poccupation}
                                {else}
                                	{html_options options=$arrOccupation}
                                {/if}
                            </select>
                        </td>
                        <td width="20%" class="lastChild">
                            <label for="pposition">Chức vụ:</label>
                            <select name="pposition" id="pposition">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                	{html_options options=$arrPosition selected=$smarty.session.post.pposition}
                                {else}
                                	{html_options options=$arrPosition}
                                {/if}
                            </select>
                        </td>
                    </tr>    
                {elseif $type == 2}
                    <tr>        
                        <td width="20%" class="firstChild" >
                            <label for="pkey">Email:</label>
                            <input type="text" name="pkey" id="pkey" value="{if isset($smarty.session.post)}{$smarty.session.post.pkey|escape}{/if}"/>
                        </td>                
                        <td width="20%">
                            <label for="pgender">Giới tính:</label>
                            <select name="pgender" id="pgender">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                    {html_options options=$arrGender selected=$smarty.session.post.pgender}
                                {else}
                                    {html_options options=$arrGender}
                                {/if}
                            </select>
                        </td>
                        <td width="20%">
                            <label for="pcountry">Quốc gia:</label>
                            <select name="pcountry" id="pcountry">                              
                                {if isset($smarty.session.post)}
                                    {html_options options=$arrCountry selected=$smarty.session.post.pcountry}
                                {else}
                                    {html_options options=$arrCountry selected=$smarty.const.COUNTRY_DEFAULT}
                                {/if}
                            </select>
                        </td>
                        <td width="20%" class="lastChild">
                            <label for="pprovince">Tỉnh/thành:</label>
                            <select name="pprovince" id="pprovince">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                    {html_options options=$arrProvince selected=$smarty.session.post.pprovince}
                                {else}
                                    {html_options options=$arrProvince}
                                {/if}
                            </select>
                        </td>
                        <td class="lastChild">
                            <label for="pafrom">Độ tuổi:</label>
                            <select name="pafrom" id="pafrom" class="half firstItem">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                    {html_options options=$arrAge selected=$smarty.session.post.pafrom}
                                {else}
                                    {html_options options=$arrAge}
                                {/if}
                            </select>
                            <select name="pato" id="pato" class="half">
                                <option value="0">Tất cả</option>
                                {if isset($smarty.session.post)}
                                    {html_options options=$arrAge selected=$smarty.session.post.pato}
                                {else}
                                    {html_options options=$arrAge}
                                {/if}
                            </select>
                        </td>                        
                    </tr> 
                    <tr>
                        <td width="20%" class="firstChild">
                            <label for="pstartdate">Ngày đăng ký:</label>
                            <input type="text" name="pstart" id="pstartdate" class="half firstItem"/>
                            <input type="text" name="pend" id="penddate" class="half"/>
                        </td>
                        <td colspan="4">&nbsp;</td>
                    </tr>   
                    
                {/if}
                <tr>
                     <td align="center" colspan="5">
                        <input type="submit" value="Tìm kiếm" class="btn"/>
                        {if isset($smarty.session.pcancel) && $smarty.session.pcancel == 1}                
                            <input type="button" value="Thôi tìm kiếm" class="btnCancel" onclick="javascript:cancelSearch(this.form);"/>
                        {/if}
                    </td>
                </tr>
            </tbody>
    	</table>
    </div>
{/if}